<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core'%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
	<%@include file="../include.jsp"%>
	<script	src="../static/lib/ztree/jquery.ztree.all-3.5.min.js"></script>
	<link  href="../static/lib/ztree/zTreeStyle.css" type="text/css" rel="stylesheet" >
</head>
<body id="z_body">
	<div class="panel">
		<div class="panel-heading">
			<i class="icon icon-list"></i> 
			${act}资源库字典项
		</div>
		<div class="panel-body">
			<div class="row">
				<div>
					<form class="form-horizontal" id="form1">
					<c:if test="${act == '修改'}">
						<input name="czType" value="edit" type="hidden"/>
					</c:if>
					<c:if test="${act == '新增'}">
						<input name="czType" value="add" type="hidden"/>
					</c:if>
						<input name="bh" value="${obj.bh}" type="hidden"/>
						
						<div class="form-group">
							<label class="col-md-3 app_required">属性代码</label>
							<div class="col-md-6">
								<input class="form-control" name="zysx" value="${obj.zysx}"  validType="notEmpty" id="zysx">
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-3 app_required">属性名称</label>
							<div class="col-md-6">
								<input class="form-control" name="zysxmc" value="${obj.zysxmc}"  validType="notEmpty">
							</div>
						</div>
						<div class="form-group">
								<label class="col-md-3 app_required">资源类型</label>
								<div class="col-md-6">
									<input class="form-control" name="zylx" validType="notEmpty"  type="hidden" value="${obj.zylx}">
									<input class="form-control app_selector" name="zylxms"  id="zylxms" value="${obj.zylxms}"
										data_tree="{type:'zykzd', multi:false, fresh:true, extra:''}">
								</div>
							</div>
					</form>
				</div>
			</div>
			
			<div style="text-align: center;">
				<a class="btn btn-primary" onclick="save()">保存</a> &nbsp;
				<a class="btn btn-default" onclick="parent.closeModal()">取消</a>
			</div>
			
		</div>
	</div>
	
	
<script type="text/javascript">
	
	
	/**
	 * 保存
	 */
	function save() {
		if(validateForm("form1")) {//表单验证
			tool.save("../zykzd/save", $("#form1").serialize(), function(res) {
				parent.getPage();
				setTimeout(function(){
					parent.closeModal();
				}, 800);
			});
		}
	}
</script>

</body>
</html>